# Contributor: psykose <alice@ayaya.dev>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=libnvme
pkgver=1.0
pkgrel=0
pkgdesc="C Library for NVM Express on Linux"
url="https://github.com/linux-nvme/libnvme/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	json-c-dev
	linux-headers
	meson
	openssl-dev
	python3-dev
	swig
	util-linux-dev
	"
subpackages="$pkgname-dev py3-nvme:_py3 $pkgname-doc"
source="https://github.com/linux-nvme/libnvme/archive/v$pkgver/libnvme-v$pkgver.tar.gz
	scope-delimiter.patch
	"

build() {
	abuild-meson \
		-Ddocs=man \
		. output
	meson compile -C output
}

check() {
	meson test -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

_py3() {
	pkgdesc="$pkgdesc (python bindings)"
	amove usr/lib/python3*
}

sha512sums="
119c5f0f6eef47c8922d7c40ff8b6374e211364d8d2df64f1fcc72f2f83216fd81d55e7667d126ab6304128bb58f8e491f845b5a247f64b639a1654a57580f7c  libnvme-v1.0.tar.gz
c9a51a6cbf2b32f7470031e9131a09aab6c2f3fe01a198e0ef957da76dda833a8651883c7a04a07dc07f5c340acb1f1ead01d5da6eb4000c44117953175c91bc  scope-delimiter.patch
"
